project(armelnonjit)

add_definitions(-DALT_JIT)
add_definitions(-DFEATURE_NO_HOST)
add_definitions(-DSELF_NO_HOST)
remove_definitions(-DFEATURE_MERGE_JIT_AND_ENGINE)

remove_definitions(-DFEATURE_SIMD)
remove_definitions(-DFEATURE_HW_INTRINSICS)

if(FEATURE_READYTORUN)
  add_definitions(-DFEATURE_READYTORUN_COMPILER)
endif(FEATURE_READYTORUN)

if (CLR_CMAKE_HOST_ARCH_I386)
    remove_definitions(-DTARGET_X86)
    add_definitions(-DTARGET_ARM)
    add_definitions(-DARM_SOFTFP)
    add_definitions(-DFEATURE_EH_FUNCLETS)
    set(JIT_ARCH_SOURCES ${JIT_ARM_SOURCES})
    set(JIT_ARCH_LINK_LIBRARIES gcinfo_arm)
elseif(CLR_CMAKE_HOST_ARCH_AMD64)
    remove_definitions(-DTARGET_AMD64)
    add_definitions(-DTARGET_ARM64)
    set(JIT_ARCH_SOURCES ${JIT_ARM64_SOURCES})
    set(JIT_ARCH_LINK_LIBRARIES gcinfo_arm64)
else()
    clr_unknown_arch()
endif()

if (NOT CLR_CMAKE_HOST_WIN32)
    if (CLR_CMAKE_HOST_ARCH_I386)
        remove_definitions(-DUNIX_X86_ABI)
    elseif(CLR_CMAKE_HOST_ARCH_AMD64)
        remove_definitions(-DUNIX_AMD64_ABI)
    else()
        clr_unknown_arch()
    endif()
endif(NOT CLR_CMAKE_HOST_WIN32)

add_jit(armelnonjit)
